pkg_name=charfbuzz
git_commit=c3c7c886bca4c42f3c55169dbba1234f4889431d
build_dir=$builds_dir_root/$pkg_name
pkg_dir=$pkgs_dir_root/$pkg_name
src_dir=$src_dir_root/$pkg_name
url=https://github.com/sylware/$pkg_name.git

rm -Rf "$pkg_dir"
cp -r "$src_dir" "$pkg_dir"

cd "$pkg_dir"

git checkout --force $git_commit
git reset --hard

rm -Rf "$build_dir"
mkdir -p "$build_dir"
cd "$build_dir"

$pkg_dir/make

install_tmp_dir=/tmp/$pkg_name
rm -Rf "$install_tmp_dir"
mkdir -p "$install_tmp_dir/lib/pkgconfig"
cp -f "$build_dir/fake_root/lib/libharfbuzz.so.0.9.20" "$install_tmp_dir/lib"
ln -sf libharfbuzz.so.0.9.20 "$install_tmp_dir/lib/libharfbuzz.so.0"
ln -sf libharfbuzz.so.0 "$install_tmp_dir/lib/libharfbuzz.so"
cp -f "$build_dir/fake_root/lib/pkgconfig/harfbuzz.pc" "$install_tmp_dir/lib/pkgconfig"
cp -rf "$build_dir/fake_root/include" "$install_tmp_dir"

install_dirs "$builders_dir_root/$pkg_name/runtime.dirs"
install_files "$builders_dir_root/$pkg_name/runtime.files" "$install_tmp_dir"
install_links "$builders_dir_root/$pkg_name/runtime.links"
install_dirs "$builders_dir_root/$pkg_name/devel.dirs"
install_files "$builders_dir_root/$pkg_name/devel.files" "$install_tmp_dir"
install_links "$builders_dir_root/$pkg_name/devel.links"
elf_strip "$builders_dir_root/$pkg_name/elf-strip"

rm -Rf "$install_tmp_dir"
rm -Rf "$build_dir"
rm -Rf "$pkg_dir"
